import QtQuick 2.5
import "../../js/UI.js" as Style
import "../common"
Rectangle {
    id: rect
    height: m_lineValue*1.1
    property alias m_text: m_Text_id.text
    property alias m_textWidth: m_Text_id.width
    property alias font_bold:m_Text_id.font.bold
    property bool m_enabled: true

    property alias m_textFontSize: m_Text_id.font.pointSize
    property alias m_textColor: m_Text_id.color

    signal clickSignal
    activeFocusOnTab :true
    AText {
        id: m_Text_id
        anchors.centerIn: parent
        color: "#ffffff"
        font.pointSize: Style.fontBtnSize
        leftPadding: rect.height * 0.2
        rightPadding: rect.height * 0.2
    }

    color: "transparent"
    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: {
            if (m_enabled)
                clickSignal()
        }
    }
    states: State {
        name: "pressed"; when: mouseArea.pressed
        PropertyChanges { target: rect ; color: Style.transparent_color;}
    }

    transitions: Transition {
//            ColorAnimation { duration: duration_time }
    }
    radius: m_lineValue*0.1
}

